<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function user(){name:"sa"}
        console.dir(user);//constructor: ƒ user()  原型的构造函数指向函数本身
        console.log(user.prototype.constructor==user);//true

    console.log(user.prototype.constructor);//ƒ user(){name:"sa"}

      //使用构造器来new对象
      function func(name){
       this.name=name;//闭包
      }
      let f=new func.prototype.constructor("唐玮");
      console.log(f);//func {name: '唐玮'}
    </script>
</body>
</html>